<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // a³=b³+c³+d³ 100 >= a>b>c>d > 0
    // 范围: (0-100]

    // 4曾for循环嵌套 
    // a 范围   2  -  100
    // b 范围   2  -  a-1 
    // c 范围   2  -  b-1
    // d 范围   2  -  c-1
    let arr = []
    for (let a = 2; a <= 100; a++) {
      for (let b = 0; b < a - 1; b++) {
        for (let c = 0; c < b - 1; c++) {
          for (let d = 0; d < c - 1; d++) {
            if (a * a * a === b * b * b + c * c * c + d * d * d) {
              arr.push([a, b, c, d])
            }
          }
        }
      }
    }
    console.log(arr);
  </script>
</body>

</html>